<@html>
<script type="text/javascript" src="${path}/js/dojo/dojo/inputForm.gzjs"></script>
<script type="text/javascript">
	//dojo.require("dijit.dijit");
	//dojo.require("dijit.form.Form");
	//dojo.require("dijit.form.Button");
	//dojo.require("dijit.form.NumberTextBox");
	//dojo.require("dijit.form.ValidationTextBox");
</script>
<form jsId="detailForm" id="detailForm" method="post" dojoType="dijit.form.Form">
	<table>
		<tr>
			<td>
			<@s.text name="noteType"/>：
			</td>
			<td>
				<input id="noteType" name="snSetup.noteType" dojoType="dijit.form.ValidationTextBox"
				       promptMessage="单据类型"/>
			</td>
			<td>
			<@s.text name="noteName"/>：
			</td>
			<td>
				<input id="noteName" name="snSetup.noteName" dojoType="dijit.form.ValidationTextBox"
				       promptMessage="单据名称"/>
			</td>
			<td>
			<@s.text name="dateFmt"/>：
			</td>
			<td>
				<input id="dateFmt" name="snSetup.dateFmt" dojoType="dijit.form.ValidationTextBox"
				       promptMessage="时间格式化字符串"/>
			</td>
		</tr>
		<tr>
			<td>
			<@s.text name="notePrefix"/>：
			</td>
			<td>
				<input id="notePrefix" name="snSetup.notePrefix" dojoType="dijit.form.ValidationTextBox"
				       promptMessage="单据前缀"/>
			</td>
			<td>
			<@s.text name="growStep"/>：
			</td>
			<td>
				<input id="growStep" name="snSetup.growStep" dojoType="dijit.form.NumberTextBox" promptMessage="递增步伐"/>
			</td>
			<td>
			<@s.text name="snLength"/>：
			</td>
			<td>
				<input id="snLength" name="snSetup.snLength" dojoType="dijit.form.NumberTextBox" promptMessage="流水号长度"/>
			</td>
		</tr>
		<tr>
			<td>
			<@s.text name="leftPadChar"/>：
			</td>
			<td>
				<input id="leftPadChar" name="snSetup.leftPadChar" dojoType="dijit.form.ValidationTextBox"
				       promptMessage="左边补齐字符"/>
			</td>
		</tr>
	</table>
<@listButton/>
</form>
</@html>
<script language="javascript" type="text/javascript">
	dojo.ready(function() {
		//事件注册
		//保存
		dojo.subscribe('btnSave.click', null, function() {
			//校验表单
			if (detailForm.validate()) {
				dojo.xhrPost({
							url : "${path!}/system/snsetup.add.do",
							form : dojo.byId("detailForm"),
							handleAs : "json",
							load : function(json) {
								handleJsonMessage({
											message:json,
											callback:function() {
												parent.publish("snsetup/refresh");
												parent.closeDialog();
											}
										})
							}
						})
			}
		})
	})
</script>
